﻿<%@ Page Title="" Language="C#" MasterPageFile="~/settings/SettingsMaster.master" AutoEventWireup="true" Inherits="Settings.Theme.StyleList" Codebehind="StyleList.aspx.cs" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 

<%@ Register src="../Controls/EntityEdit.ascx" tagname="EntityEdit" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<h2 class="pagetitle">Styles</h2>

<asp:UpdatePanel ID="udpOutterUpdatePanel" runat="server"> 
     <ContentTemplate> 

<asp:DataGrid ID="grdDesigns" runat="server" AutoGenerateColumns="false"  onitemcommand="grdDesigns_ItemCommand" OnItemDataBound="grdDesign_ItemDataBound" ShowFooter="true" >
    <Columns>
        <asp:BoundColumn DataField="Id" readonly="true" Visible="false"/>
        <asp:BoundColumn DataField="Name" HeaderText="Name" />
        <asp:BoundColumn DataField="State" HeaderText="State" />
        <asp:BoundColumn DataField="CreatedBy" HeaderText="Created By" />
        <asp:BoundColumn DataField="UseCount" HeaderText="Use count" />
        <asp:TemplateColumn ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right">
            <ItemTemplate>
                <asp:Button CommandName="Source" Text="Source" ButtonType="PushButton" CssClass="greenbutton"  runat="server" />
                <asp:Button ID="Button2" CommandName="Edit" Text="Edit" ButtonType="PushButton" CssClass="greenbutton"  runat="server"/>    
                <asp:Button ID="btnDelete" CommandName="Delete" Text="Delete" ButtonType="PushButton" CssClass="redbutton"  runat="server"/>    
            </ItemTemplate>
            <FooterTemplate>
                <asp:Button ID="btnNew" runat="server" Text="New" OnClick="btnNew_Click" CssClass="greenbutton" CommandName="New" />
            </FooterTemplate>
        </asp:TemplateColumn>
    </Columns>
</asp:DataGrid>

    <ajaxToolkit:ModalPopupExtender runat="server" 
        ID="mpeTextEdit" 
        TargetControlID="dummy" 
        PopupControlID="pnlModalPopUpPanel" 
        BackgroundCssClass="modalBackground"                        
        DropShadow="false"
        PopupDragHandleControlID="lblTitle"
        /> 

    <input id="dummy" type="button" style="display: none" runat="server" /> 

     <asp:Panel ID="pnlModalPopUpPanel" runat="server" CssClass="windowStyle"  style="display:none;" >             
        <asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional"> 
            <ContentTemplate>     
                <asp:Label ID="lblTitle" runat="server" Text="Page title"  CssClass="title" />
                <asp:ImageButton ID="btnClose" runat="server" ImageUrl="~/Images/dialog-close.png" style="position:absolute; top: -10px; right:-10px;" />
                <asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/Images/dialog-greentick.png" style="position:absolute; top: -10px; right:30px;" Text="Save" OnClick="btnSave_Click" />
                <asp:TextBox ID="txtBox" runat="server" width="950" Height="500" TextMode="MultiLine" style="border: 1px solid #ccc; font-family: Lucida Console, Monospace; padding: 5px;"  /><br />
                <asp:Literal ID="litErrors" runat="server" />
            </ContentTemplate>       
        </asp:UpdatePanel> 
    </asp:Panel>


    <ajaxToolkit:ModalPopupExtender runat="server" 
        ID="mpeEditEntity" 
        TargetControlID="dummy2" 
        PopupControlID="pnlEditEntity" 
        BackgroundCssClass="modalBackground"                        
        DropShadow="false"
        /> 
        
     <input id="dummy2" type="button" style="display: none" runat="server" /> 

     <asp:Panel ID="pnlEditEntity" runat="server" CssClass="modalPopup"  style="display:none;" >             
        <asp:UpdatePanel ID="UpdatePanel1" runat="Server" UpdateMode="Conditional"> 
            <ContentTemplate>     
                <asp:ImageButton ID="Imagebutton1" runat="server" ImageUrl="~/Images/dialog-close.png" style="position:absolute; top: -10px; right:-10px;" />

                <uc1:EntityEdit ID="editDesign" runat="server"  Caption="Style" OnUpdate="editDesign_Update"   />

            </ContentTemplate>       
        </asp:UpdatePanel> 
    </asp:Panel>

   </ContentTemplate> 
</asp:UpdatePanel> 

</asp:Content>

